package com.example.questionnaires.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.questionnaires.entity.Carousel;
import com.example.questionnaires.mapper.CarouselMapper;
import com.example.questionnaires.service.CarouselService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarouselServiceImpl extends ServiceImpl<CarouselMapper, Carousel> implements CarouselService {
    
    @Override
    public List<Carousel> getActiveCarousels() {
        return list(new LambdaQueryWrapper<Carousel>()
                .eq(Carousel::getStatus, 1)
                .orderByAsc(Carousel::getSort)
                .orderByDesc(Carousel::getCreateTime));
    }
} 